package cn.wolfcode.wolf2w.common.redis.util;

import lombok.Getter;

@Getter
public enum RedisKeys {

    BRUSH("brush",60),

    NOTE_STATIS_HASH("note_statis_hash",-1L),
    USER_NOTE_FAVOR("user_note_favor",-1L),
    USER_STRATEGY_THUMBSUP("user_strategy_thumbsup",-1L),
    USER_NOTE_THUMBSUP("user_note_thumbsup",-1L),
    USER_STRATEGY_FAVOR("user_strategy_favor",-1L),
    STRATEGY_STATIS_HASH("strategy_statis_hash", -1L),
    VERIFY_CODE("verify_code",5*60);


    private String prefix;//key的前缀
    private long time;//key 的过期时间
    private RedisKeys(String prefix,long time){
        this.prefix=prefix;
        this.time=time;
    }

    public String join(String... value){
        StringBuffer sb=new StringBuffer();
        sb.append(this.prefix);
       for(String s:value){
           sb.append(":").append(s);
       }
       return sb.toString();
    }

}
